home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / fdate42c.zip / HOLIDAYS.BAT < prev    next >
DOS Batch File  |  1992-01-10  |  7KB  |  154 lines

  1. @echo off
  2. CLS
  3. goto endcomment
  4. HOLIDAYS.BAT for FDATE version 4.2c
  5. ===================================
  6. If you have any corrections to the algorithms
  7. in this batch file, please send them to Steve Ferg.
  8.  
  9. Revision history:
  10. ===================================
  11. 4.2b Jan 6, 1992
  12.      Corrected algorithm for Advent (thanks to L. Schliesser)
  13. 4.2c Jan 10, 1992
  14.      Added entry for LABOR DAY (1st Monday in Sept) (thanks to L. S.)
  15.  
  16. :endcomment
  17.  
  18. if not (%1)==() goto nohelp
  19. echo ───────────────────────────────────────────────────────────────────────────────
  20. echo                   HOW TO USE HOLIDAYS.BAT
  21. echo ───────────────────────────────────────────────────────────────────────────────
  22. ECHO HOLIDAYS without any parameters displays events in current year.
  23. ECHO.
  24. ECHO HOLIDAYS [year]                 displays events in [year].
  25. ECHO EXAMPLE: HOLIDAYS 1999          displays events in year 1999.
  26. ECHO.
  27. ECHO.
  28. ECHO.
  29. ECHO To print the calendar, press SHIFT+PRINTSCREEN to print each screen.
  30. ECHO.
  31. pause
  32. cls
  33. :nohelp
  34.  
  35.  
  36. rem --------------------------------------------------------
  37. rem get current year
  38. rem --------------------------------------------------------
  39. Fdate /Ff /At /Occyy /P"@set year=" >junktemp.bat
  40. call junktemp.bat
  41. del  junktemp.bat
  42.  
  43.  
  44. REM if user specifies a year as parm1, use it
  45. if not (%1)==() set year=%1
  46.  
  47.  
  48. rem --------------------------------------------------------
  49. rem Determine if year is a leapyear
  50. rem AND check for validity of year parm (%1)
  51. rem --------------------------------------------------------
  52. Fdate /Ff /Imm-dd-ccyy /A01-01-%year% /Oly /P"@set LY=">junktemp.bat
  53. call junktemp.bat
  54. del  junktemp.bat
  55. if (%LY%)==(ERROR) echo Parm #1 was not a valid year: %1
  56. if (%LY%)==(ERROR) goto endit
  57.  
  58.  
  59.  
  60. echo ───────────────────────────────────────────────────────────────────────────────
  61. if (%LY%)==(0) ECHO                   EVENTS IN %YEAR%  (part 1)
  62. if (%LY%)==(1) ECHO                   EVENTS IN %YEAR%  (part 1)       Note: %year% is a leap year
  63. echo ───────────────────────────────────────────────────────────────────────────────
  64. Fdate /Ff /Imm-dd-ccyy /Od1 /a01-01-%year% /P"New Year's Day........................"
  65. Fdate /Ff /Imm-dd-ccyy /Od1 /A01-06-%year% /P"Epiphany.............................."
  66. Fdate /Fw /D2 /N3 /A01-01-%year% /Imm-dd-ccyy /Od1 /P"Martin Luther King, Jr. Day..........."
  67. Fdate /Ff /Imm-dd-ccyy /Od1 /a02-14-%year% /P"Valentine's day......................."
  68. Fdate /Fw /D2 /N3 /A02-01-%year% /Imm-dd-ccyy /Od1 /P"Presidents' Day......................."
  69. Fdate /Ff /Imm-dd-ccyy /Od1 /a03-17-%year% /P"St. Patricks's Day...................."
  70.  
  71. if (%LY%)==(1) Fdate /Ff /Imm-dd-ccyy /Od1 /a02-29-%year% /P"Sadie Hawkins Day....................."
  72. set ly=
  73.  
  74. REM ========== begin: DATES TIED TO EASTER==============================
  75. set easter=
  76. if (%year%)==(1991) set easter=03-31-%year%
  77. if (%year%)==(1992) set easter=04-19-%year%
  78. if (%year%)==(1993) set easter=04-11-%year%
  79. if (%year%)==(1994) set easter=04-03-%year%
  80. if (%year%)==(1995) set easter=04-16-%year%
  81. if (%year%)==(1996) set easter=04-07-%year%
  82. if (%year%)==(1997) set easter=03-30-%year%
  83. if (%year%)==(1998) set easter=04-12-%year%
  84. if (%year%)==(1999) set easter=04-04-%year%
  85. if (%year%)==(2000) set easter=04-23-%year%
  86. if (%year%)==(2001) set easter=04-15-%year%
  87. if (%easter%)==() goto unknown
  88. echo.
  89. Fdate /Fsub /Imm-dd-ccyy /N40 /Od1 /a%easter% /P"Mardi Gras (Shrove Tuesday)..........."
  90. Fdate /Fsub /Imm-dd-ccyy /N46 /Od1 /a%easter% /P"Ash Wednesday (Lent begins)..........."
  91. Fdate /Fsub /Imm-dd-ccyy /N7  /Od1 /a%easter% /P"Palm Sunday..........................."
  92. Fdate /Fsub /Imm-dd-ccyy /N2 /Od1  /A%easter% /P"Good Friday..........................."
  93. Fdate /Ff   /Imm-dd-ccyy      /Od1 /a%easter% /P"Easter................................"
  94. echo.
  95. :unknown
  96. REM ==========   end: DATES TIED TO EASTER==============================
  97.  
  98. Fdate /Fw /D4 /N4 /A04-01-%year% /Imm-dd-ccyy /Od1 /P"Secretaries Day......................."
  99. Fdate /Ff /Imm-dd-ccyy /Od1 /a05-05-%year% /P"Cinco de Mayo (Mexico)................"
  100.  
  101. Fdate /Fw /D1 /N2 /A05-01-%year% /Imm-dd-ccyy /Od1 /P"Mother's Day.........................."
  102. Fdate /Fw /D2 /N-1 /A05-24-%year% /Imm-dd-ccyy /Od1 /P"Victoria Day (Canada)................."
  103. Fdate /FW /D2 /N-1 /a05-31-%year% /Imm-dd-ccyy /Od1 /P"Memorial Day (observed)..............."
  104.  
  105. echo ───────────────────────────────────────────────────────────────────────────────
  106. PAUSE
  107. CLS
  108. echo ───────────────────────────────────────────────────────────────────────────────
  109. ECHO                   EVENTS IN %YEAR%  (part 2)
  110. echo ───────────────────────────────────────────────────────────────────────────────
  111.  
  112. if not (%easter%)==() Fdate /Fadd /Imm-dd-ccyy /N39 /Od1 /A%easter% /P"Ascension Day........................."
  113. if not (%easter%)==() Fdate /Fadd /Imm-dd-ccyy /N49 /Od1 /A%easter% /P"Pentecost............................."
  114. if not (%easter%)==() echo.
  115. Fdate /Ff /Imm-dd-ccyy /Od1 /A06-14-%year%  /P"Flag Day.............................."
  116. rem ----- anniversary of Bloom's Day, June 16, 1904 ------------------
  117. rem Here's a way to show an anniversary or event that you want to note.
  118. rem Thanks to L. Schliesser for the algorithm.
  119. rem ------------------------------------------------------------------
  120. Fdate /F#dif /A%year% /B1904 /P"@set ann=">junktemp.bat
  121. call junktemp.bat
  122. del junktemp.bat
  123. Fdate /Ff /Imm-dd-ccyy /a06-16-%year% /Od1 /P"Bloom's Day (%ann%th anniversary)........"
  124. rem ---------------end bloom's day --------------------------------------
  125.  
  126. Fdate /Fw /D1 /N3 /A06-01-%year% /Imm-dd-ccyy /Od1 /P"Father's Day.........................."
  127. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-01-%year% /P"Canada Day (Canada)..................."
  128. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-04-%year% /P"Independence Day (USA)................"
  129. Fdate /Ff /Imm-dd-ccyy /Od1 /a07-14-%year% /P"Bastille Day (France)................."
  130.  
  131. echo.
  132. Fdate /Fw /D2 /N1 /A09-01-%year% /Imm-dd-ccyy /Od1 /P"Labor Day............................."
  133.  
  134. rem ---- begin ------- note a particular day in a particular year
  135. rem This technique is useful for noting special events:
  136. rem 21st birthdays, 50th wedding anniversaries, etc.
  137. if (%year%)==(1992) Fdate /Ff /Imm-dd-ccyy /Od1 /a10-12-%year% /P"500th ann. of Columbus's discovery...."
  138. rem ----  end -------- note a particular day in a particular year
  139.  
  140. Fdate /Fw /D2 /N2 /A10-01-%year% /Imm-dd-ccyy /Od1 /P"Columbus Day (observed)..............."
  141. Fdate /Ff /Imm-dd-ccyy /Od1 /a11-11-%year% /P"Veteran's Day........................."
  142.  
  143. Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving Day......................"
  144.  
  145.  
  146. Fdate /Fw /D1 /N-4 /A12-24-%year% /Imm-dd-ccyy /Od1 /P"First Sunday in Advent................"
  147. Fdate /Ff /Imm-dd-ccyy /Od1 /a12-25-%year% /P"Christmas............................."
  148. Fdate /fadd /Imm-dd-ccyy /Od1 /N1 /a12-31-%year% /P"New Year's Day........................"
  149. echo ───────────────────────────────────────────────────────────────────────────────
  150. :endit
  151. set year=
  152. set easter=
  153. set LY=
  154.